package cn.ihww.mybatis.model;

import com.iwjw.ibatis.annotations.Column;
import com.iwjw.ibatis.annotations.PrimaryKey;
import com.iwjw.ibatis.annotations.Table;
import lombok.Data;

import java.util.Date;

/**
 * @author iwjw
 * @Time 2016/11/07
 */
@Data
@Table(name = "user", resultMap = "BaseResultMap")
public class User {
    /**
     * 主键ID
     */
    public static final String ID = "id";
    /**
     * 名称
     */
    public static final String NAME = "name";
    /**
     * 年龄
     */
    public static final String AGE = "age";
    /**
     * 密码
     */
    public static final String PASSWORD = "password";
    /**
     * 创建日期
     */
    public static final String CREATE_TIME = "created";
    public static final String LAST_MODIFIED = "lastModified";

    /**
     * 主键ID
     */
    @PrimaryKey
    @Column(jdbcType = "BIGINT")
    private Long id;
    /**
     * 名称
     */
    @Column(jdbcType = "VARCHAR")
    private String name;
    /**
     * 年龄
     */
    @Column(jdbcType = "INT")
    private Integer age;
    /**
     * 密码
     */
    @Column(jdbcType = "VARCHAR")
    private String password;
    /**
     * 创建日期
     */
    @Column(name = "created", jdbcType = "DATETIME")
    private Date createTime;
    @com.iwjw.ibatis.annotations.OptimisticKey
    @Column(jdbcType = "DATETIME")
    private Date lastModified;

}